﻿using AutoMapper;

using System;

namespace Holla.Infrastructure.TestBase
{
    public static class AutoMapperFactory
    {
        public static IMapper Create<T>() where T : Profile
        {
            var profile = Activator.CreateInstance<T>();
            var mappingConfig = new MapperConfiguration(mc => mc.AddProfile(profile));
            return mappingConfig.CreateMapper();
        }
    }
}
